package com.syswin.lhztest.demoSwagger.service;

import com.syswin.lhztest.demoSwagger.service.event.OrderEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import java.applet.AppletContext;

/**
 *
 * @author:lhz
 * @date:2018/11/14 15:47
 */
@Service
public class OrderService {

    @Autowired
    ApplicationContext applicationContext;

    public void saveOrder(){
            //创建订单
        System.out.println("1、订单创建成功");
        //发出一个订单创建事件
        applicationContext.publishEvent(new OrderEvent(""));

    }

}
